<?php
//ReCost
//重新计算已售商品的成本
require '../global.php';

$db = getDB();

$data = $db->getAll(getTable('items'), 'id,pricein');

foreach ($data as $v) {
    $db->sql("UPDATE ".getTable('indentd')." SET cost={$v['pricein']} WHERE iid={$v['id']} AND cost=0");
    echo ".";
}
?>
